package com.woniu.userservice.service.impl;

import com.woniu.userservice.entity.Messages;
import com.woniu.userservice.dao.MessagesDao;
import com.woniu.userservice.service.MessagesService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("messagesService")
public class MessagesServiceImpl implements MessagesService {
    @Resource
    private MessagesDao messagesDao;

    @Override
    public Messages queryById(Integer id) {
        return messagesDao.queryById(id);
    }

    @Override
    public List<Messages> queryAllByLimit(int offset, int limit) {
        return messagesDao.queryAllByLimit(offset, limit);
    }
   
     @Override
    public List<Messages> findAll() {
        return messagesDao.findAll();
    }

    @Override
    public Messages insert(Messages messages) {
        messagesDao.insert(messages);
        return messages;
    }

    @Override
    public Messages update(Messages messages) {
        messagesDao.update(messages);
        return queryById(messages.getId());
    }

    @Override
    public boolean deleteById(Integer id) {
        return messagesDao.deleteById(id) > 0;
    }

    @Override
    public Integer selectReminderpeople(Integer goodsid) {
        return messagesDao.selectReminderpeople(goodsid);
    }
}